// 视图组件
const view = {
    tabs: () => import('@/layouts/tabs'),
    blank: () => import('@/layouts/BlankView'),
    page: () => import('@/layouts/PageView')
}

// 路由组件注册
const routerMap = {
    login: {
        authority: '*',
        path: '/login',
        component: () => import('@/pages/login')
    },
    exp403: {
        authority: '*',
        name: 'exp403',
        path: '403',
        component: () => import('@/pages/exception/403')
    },
    exp404: {
        name: 'exp404',
        path: '404',
        component: () => import('@/pages/exception/404')
    },
    exp500: {
        name: 'exp500',
        path: '500',
        component: () => import('@/pages/exception/500')
    },
    root: {
        path: '/',
        name: '首页',
        redirect: '/dashboard',
        component: view.tabs
    },
    dashboard: {
        path: 'dashboard',
        name: '工作台',
        meta: {
            icon: 'dashboard'
        },
        page: {
            closable: false
        },
        component: () => import('@/pages/dashboard')
    },
    mysettings: {
        path: 'mysettings',
        name: '个人设置',
        invisible: true,
        meta: {
            icon: 'setting'
        },
        component: () => import('@/pages/mysettings')
    },
    auth: {
        path: 'auth',
        name: '用户权限',
        redirect: '/auth/userlist',
        meta: {
            icon: 'user'
        },
        component: view.blank,
    },
    userlist: {
        path: 'userlist',
        name: '用户管理',
        meta: {
            icon: 'user',
        },
        component: () => import('@/pages/auth/userlist'),
    },
    rolelist: {
        path: 'rolelist',
        name: '角色管理',
        meta: {
            icon: 'team',
        },
        component: () => import('@/pages/auth/rolelist'),
    },
    rolefuns: {
        path: '/auth/rolefuns/:roleid',
        name: '设置角色权限',
        invisible: true,
        component: () => import('@/pages/auth/rolefuns'),
    },
    funlist: {
        path: 'funlist',
        name: '权限管理',
        meta: {
            icon: 'safety-certificate'
        },
        component: () => import('@/pages/auth/funlist'),
    },
    exception: {
        name: '异常页',
        icon: 'warning',
        component: view.blank
    },
    setting: {
        path: 'setting',
        name: '系统设置',
        redirect: '/setting/commission',
        meta: {
            icon: 'setting'
        },
        component: view.blank,
    },
    exchangerate: {
        path: 'exchangerate',
        name: '汇率设置',
        meta: {
            icon: 'transaction'
        },
        component: () => import('@/pages/setting/exchangerate'),
    },
    commission: {
        path: 'commission',
        name: '全局佣金',
        meta: {
            icon: 'money-collect'
        },
        component: () => import('@/pages/setting/commission'),
    },
    supplier: {
        path: 'supplier',
        name: '供应商',
        redirect: '/supplier/list',
        meta: {
            icon: 'container'
        },
        component: view.blank,
    },
    supplierlist: {
        path: 'list',
        name: '供应商酒店',
        meta: {
            icon: 'unordered-list',
        },
        component: () => import('@/pages/supplier/list'),
    },
    supplierhotel: {
        path: '/supplier/hotel/:supplier/:supplierHotelId',
        name: '供应商酒店详细',
        invisible: true,
        component: () => import('@/pages/supplier/hotel'),
    },
    supplierconfig: {
        path: 'config',
        name: '供应商配置',
        meta: {
            icon: 'api',
        },
        component: () => import('@/pages/supplier/config'),
    },
    hotel: {
        path: 'hotel',
        name: '母酒店',
        redirect: '/hotel/list',
        meta: {
            icon: 'folder'
        },
        component: view.blank,
    },
    hoteldetail: {
        path: '/hotel/detail/:hotelId',
        name: '酒店详细',
        invisible: true,
        component: () => import('@/pages/hotel/detail'),
    },
    hotelbooking: {
        path: '/hotel/booking/:hotelId',
        name: '搜索价格',
        invisible: true,
        component: () => import('@/pages/hotel/booking'),
    },
    hotellist: {
        path: 'list',
        name: '酒店列表',
        meta: {
            icon: 'folder'
        },
        component: () => import('@/pages/hotel/list'),
    },
    mappinglist: {
        path: 'mapping',
        name: '酒店匹配',
        meta: {
            icon: 'file-search'
        },
        component: () => import('@/pages/hotel/mapping'),
    },
    distributor: {
        path: 'distributor',
        name: '分销商',
        redirect: '/distributor/hotellist',
        meta: {
            icon: 'database'
        },
        component: view.blank,
    },
    distributorhotellist: {
        path: 'hotellist',
        name: '分销商酒店',
        meta: {
            icon: 'database'
        },
        component: () => import('@/pages/distributor/hotellist'),
    },
    distributorsuppliersetting: {
        path: 'suppliersetting',
        name: '供应商分销设置',
        meta: {
            icon: 'setting'
        },
        component: () => import('@/pages/distributor/suppliersetting'),
    },
    distributorconfig: {
        path: 'configlist',
        name: '分销商API配置',
        meta: {
            icon: 'api'
        },
        component: () => import('@/pages/distributor/configlist'),
    },
    hotelcommission: {
        path: 'commissionlist',
        name: '酒店佣金',
        meta: {
            icon: 'money-collect'
        },
        component: () => import('@/pages/distributor/commissionlist'),
    },
    distributorhoteldetail: {
        path: '/distributor/detail/:distributor/:hotelId',
        name: '分销商酒店详细',
        invisible: true,
        component: () => import('@/pages/distributor/detail'),
    },
    order: {
        path: 'order',
        name: '订单管理',
        redirect: '/order/list',
        meta: {
            icon: 'ordered-list'
        },
        component: view.blank,
    },
    orderlist: {
        path: 'list',
        name: '订单列表',
        meta: {
            icon: 'ordered-list'
        },
        component: () => import('@/pages/order/list'),
    },
    orderaftersale: {
        path: 'aftersalelist',
        name: '售后订单',
        component: () => import('@/pages/order/list'),
    },
    orderdetail: {
        path: '/order/detail/:orderId',
        name: '订单详细',
        invisible: true,
        component: () => import('@/pages/order/detail'),
    },
}
export default routerMap
